package com.kafka.blogvue.controller;


import com.kafka.blogvue.common.Result;
import com.kafka.blogvue.entity.User;
import com.kafka.blogvue.service.UserService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kafka
 * @since 2023-03-07
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService us;
    @RequiresAuthentication
    @GetMapping("/index")
    public Result index(){
        User user = us.getById(1);
        return Result.succ(200,"操作成功",user);
    }
}
